import { defineStore } from 'pinia'

const useSettingStore = defineStore('Setting', {
  state() {
    return {
      fold: false, // 菜单是否折叠
      refresh: false, // 刷新按钮是否点击
      themeColor: localStorage.getItem('themeColor') || '', // 主题
    }
  },
  actions: {
    updateThemeColor(color: string) {
      localStorage.setItem('themeColor', color)
    },
  },
})

export default useSettingStore
